package net.lzzy.Job;

import java.io.Serializable;

public class Trip implements Serializable ,Comparable<Trip>{
    private int km;
    private int mis;

    public Trip() {
    }

    public Trip(int km, int mis) {
        this.km = km;
        this.mis = mis;
    }

    public int getKm() {
        return km;
    }

    public void setKm(int km) {
        this.km = km;
    }

    public int getMis() {
        return mis;
    }

    public void setMis(int mis) {
        this.mis = mis;
    }

    @Override
    public int compareTo(Trip o) {
        if (this.km>o.getKm()){
            return 1;
        }else if (this.km==o.getKm()){
            if (this.mis>o.getMis()){
                return 1;
            }else if (this.mis==o.getMis()){
                return 0;
            }else {
                return -1;
            }
        }else {
            return -1;
        }
    }
}
